﻿using CommonPatterns.MVVM;
using OCDP.Client.Services.Clock;
using System;
using OCDP.Client.Adapters;
using OCDP.Client.Model;

namespace OCDP.Client.Screens.CocoScreen
{
    public class CocoScreenViewModel : ViewModelBase, ICocoScreenViewModel
    {
        public CocoScreenViewModel(IClockService clockService)
        {
            Title = "Binded CocoScreenViewModel !!!";
            var user = new User() 
            { 
                FirstName = "Coco", 
                LastName = "Bongo", 
                Email = "coco.bongo@caramail.com", 
                Birth = DateTime.Now 
            };
            currentUser = new UserAdapter(user);
        }

        #region Properties
        private UserAdapter currentUser;
        public UserAdapter CurrentUser
        {
            get { return currentUser; }
            set
            {
                if (currentUser != value)
                {
                    currentUser = value;
                    RaisePropertyChanged(() => CurrentUser);
                }
            }
        }
        #endregion
    }
}
